/**
 * @file iap.h
 * @brief 
 * @author wangh (wanghuan3037@fiberhome.com)
 * @version 1.0
 * @date 2020-11-16
 * @copyright Copyright (c) 2020  烽火通信
 */
#ifndef __IAP_H
#define __IAP_H 
#include <stdint.h>


typedef enum
{
    IAP_UPGRADE_OK = 0,    ///< 升级完成
    IAP_UPGRADE_ON,        ///< 升级中
    IAP_UPGRADE_FAIL       ///< 升级失败
}IAP_UPGARDE;

int8_t iap_download_prepare( void );

int8_t iap_download( uint8_t *data, uint32_t size, uint32_t *cur_size, uint32_t total_size );

int8_t iap_upgrade_prepare( void );

int8_t iap_upgrade_result( uint8_t * iap_upgrade_flag );
void iap_load_app(uint32_t appxaddr);
void iap_upgrade( void );



#endif	 // __IAP_H 

/*********** (C) COPYRIGHT 2020 FiberHome *****END OF FILE****/

